<?php $this->load->view('common/ck-bosspagehead'); ?>
<?php $this->load->view('common/ck-bossheader'); ?>
<article id="content">
    <div class="pgwrapper">
    <div class="w960 bg1 p15 bx_shw">
	<table width="100%" border="0" cellpadding="0" cellspacing="0">
		<tr>
			<td width="20%" style="border-right: 2px solid #e5e5e5;" valign="top">
			<?php $this->load->view('enterprises/leftnavCMS'); ?>
			</td>
			<td width="80%" valign="top"><form enctype="multipart/form-data"
					action="/updateStoreDeals" onsubmit="return validateForm()" method="POST">
					<input type="hidden" value="<?php echo $storeDealsArray[0]['storedeals_id'];?>" name="storedeals_id">
					<input type="hidden" value="<?php echo $storeDealsArray[0]['storedeals_banner'];?>" name="old_deals_banner">
					<table width="100%" border="0" cellpadding="5" cellspacing="0"
						style="padding-left: 20px;">
						<tr>
						<td class="txt-blck">Select Store:</td>
						 <td><select id="store_id" style="width: 200px;" name="store_id" onchange="selectUrl()">
						 		<option value="0">Select</option>
			                	<?php foreach ($allStoreArray as $temp){ ?>
								<option value="<?php echo $temp['store_id']; ?>"
								<?php if($storeDealsArray[0]['store_id']==$temp['store_id']){ echo 'Selected';}?>>
								<?php echo $temp['store_name']; ?>
								</option>
								<?php } ?>		                	
			            	</select></td>
						</tr>
						<tr id="DealDiv">
								<td class="txt-blck" width="30%">Store Url:</td>
								<td width="70%"><input type="text" value="<?php echo $storeDealsArray[0]['store_url']; ?>" name="deal_url"
									id="deal_url" class="inputCMS" style="width: 300px;" readonly="readonly" />
								</td>
						</tr>
						<tr>
							<td class="txt-blck">Deal Status:</td>
							<td><select id="deal_status" name="deal_status">
									<option value="Yes"
									<?php if($storeDealsArray[0]['storedeals_status']=='Yes'){ echo 'Selected';}?>>Yes</option>
									<option value="No"
									<?php if($storeDealsArray[0]['storedeals_status']=='No'){ echo 'Selected';}?>>No</option>
							</select></td>
						</tr>
						<tr>
							<td valign="top" class="txt-blck">Deal Description1:</td>
							<td><textarea style="width: 450px; height: 300px;" class="input"
									id="deal_description1" name="deal_description1"><?php echo $storeDealsArray[0]['storedeals_desc1']; ?></textarea></td>
						</tr>
						<tr>
							<td valign="top" class="txt-blck">Deal Description2:</td>
							<td><textarea style="width: 450px; height: 300px;" class="input"
									id="deal_description2" name="deal_description2"><?php echo $storeDealsArray[0]['storedeals_desc2']; ?></textarea></td>
						</tr>
						<tr>
							<td class="txt-blck">Deal Banner:</td>
							<td><input type="file" id="deal_banner" name="deal_banner" /></td>
						</tr>
						<tr>
							<td class="txt-blck" width="30%">Deal Metatitle:</td>
							<td width="70%"><input type="text" class="inputCMS" value="<?php echo $storeDealsArray[0]['metatitle']; ?>" name="metatitle"
								id="metatitle" class="input" style="width: 300px;" />
							</td>
						</tr>
						<tr>
							<td class="txt-blck" width="30%">Deal Meta Keyword:</td>
							<td width="70%"><input type="text" value="<?php echo $storeDealsArray[0]['metakeyword']; ?>" name="metakeyword"
								id="metakeyword" class="inputCMS" style="width: 300px;" />
							</td>
						</tr>
						<tr>
							<td valign="top" class="txt-blck">Deal Meta Description:</td>
							<td><input type="text" value="<?php echo $storeDealsArray[0]['metadescription']; ?>" name="metadescription"
								id="metadescription" class="inputCMS" style="width: 300px;" /></td>
						</tr>
						<tr>
							<td></td>
							<td><input type="submit" name="deal_submit" value="Submit" /></td>
						</tr>
					</table>
				</form></td>
		</tr>
	</table>
</div>
</div>
</article>
<div class="clr-both spacer-10">&nbsp;</div>
<?php $this->load->view('common/ck-bossfooter'); ?>
<script>
function validateForm(){
	var x = document.getElementById('deal_name').value;
	if(x==""){
	alert("Store Name must be filled out.");
	return false;
	}
	var y = document.getElementById('deal_affilateurl').value;
	if(y==""){
	alert("Store Affilate Url must be filled out.");
	return false;
	}
}
</script>